package entidades;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class RegistroUsuarioHandler extends HandlerGenerico {

	String type;
	String code;
	String description;
	boolean resultado;
	
	public String getType() {
		return type;
	}

	public String getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}

	public RegistroUsuarioHandler(){
	  resultado=true;
	  type="";
	  code="";
	  description="";
	}

	
	public void startElement(String uri,String localName,String qName, Attributes attributes) throws SAXException{
		super.startElement(uri, localName, qName, attributes);
		if(localName.equals("result"))
			
			type= attributes.getValue("type");
			
		if(localName.equals("result") && attributes.getValue("type").equals("error")){
			resultado=false;
		}
		
		if(localName.equals("detail")){
         description= attributes.getValue("description");
		 code= attributes.getValue("code");
		}		
	}
	
	
	public boolean getResultadoRegistro(){
		return resultado;	
	}
	
}
